//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//院所库房物资领用单
//

package weaver.interfaces.expense.action.gzc.th;

import weaver.conn.RecordSet;
import weaver.general.BaseBean;
import weaver.general.Util;
import weaver.interfaces.util.ExpenseInfoUtil;

public class YSKFWZLY_TH_ExpenseAction extends BaseBean {
    public YSKFWZLY_TH_ExpenseAction() {
    }

    public void execute(String workflowid, String requestid) {
        this.writeLog("进入YSKFWZLY_TH_ExpenseAction-----------" + requestid);
        RecordSet rs = new RecordSet();
        rs.executeSql("select formid from workflow_base where id = " + workflowid);
        rs.next();
        String formid = rs.getString("formid");
        String formtable = "formtable_main_" + formid.replaceAll("-", "");
        ExpenseInfoUtil expenseInfoUtil = new ExpenseInfoUtil();
        String ccode = "";
        double amount = 0.0D;
        String cexpenseitemcode = "";
        String citemcode = "";
        String iyear = "";
        String iskt = "0";
        rs.execute("select a.id,b.ks,a.zcxm,a.je,b.sqrq,b.kth1,b.sf from " + formtable + "_dt1 a , " + formtable + " b where a.mainid=b.id and  b.requestid=" + requestid);

        String kth;
        for(; rs.next(); expenseInfoUtil.releaseExpense4(workflowid, ccode, cexpenseitemcode, citemcode, kth, amount, iyear, iskt)) {
            ccode = expenseInfoUtil.getKsbm(Util.null2String(rs.getString("ks")));
            amount = Util.getDoubleValue(rs.getString("je"), 0.0D);
            cexpenseitemcode = Util.null2String(rs.getString("zcxm"));
            kth = Util.null2String(rs.getString("kth1"));
            iyear = Util.null2String(rs.getString("sqrq")).substring(0, 4);
            String sfkt = Util.null2String(rs.getString("sf"));
            if("0".equals(sfkt)) {
                iskt = "1";
            }
        }

    }
}
